package com.haois.mp.database.module.wxserver.util;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by RuiHaoZ on 2018/2/1 0:34
 */
public class MapUtil<T> {
    /**
     * 0 返回码
     */
    private String code;
    /**
     * 具体信息
     */
    private String msg;
    /**
     * 返回需要的数据
     */
    private T data;

    public static Map<String, Object> createMap(String code, String msg, Object object) {
        Map<String, Object> map = new HashMap<>();
        map.put("code", code);
        map.put("msg", msg);
        map.put("data", object);
        return map;
    }

    public static Map<String, Object> createMap(String code, String msg) {
        Map<String, Object> map = new HashMap<>();
        map.put("code", code);
        map.put("msg", msg);
        return map;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getMsg() {
        return msg;
    }

    public void setMsg(String msg) {
        this.msg = msg;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }
}
